<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<body>
	<p:ajaxStatus style="width:16px;height:16px;" id="ajaxStatusPanel">
		<f:facet name="start">
			<h:graphicImage value="/images/loading.gif"
				style="text-align:center;width:40px;height:40px;" />
		</f:facet>
		<f:facet name="complete">
			<h:outputText value="" />
		</f:facet>
	</p:ajaxStatus>
	<BR />
	<h:form>
		<p:commandLink ajax="false"
			action="/view.xhtml?javax.portlet.faces.PortletMode=view&amp;javax.portlet.faces.WindowState=normal">
			<p:graphicImage value="/images/Home-Button.png" />
		</p:commandLink>
		<p:graphicImage value="/images/flags/#{myBean.selectedCountry}.png"
			style="text-align:center;width:30px;height:30px;" />
	</h:form>


	<h:form>
		<p:panel widgetVar="panel1">
			<p:dataTable var="identifier" value="#{myBean.identifiers}">
				<p:column>
					<f:facet name="header">
						<h:outputText value="#{identifier.key}" />
					</f:facet>
					<h:outputText value="#{identifier.key}" />

				</p:column>
				<p:column>
					<f:facet name="header">
					</f:facet>
					<p:inputText id="userValue" value="#{identifier.userValue}"
						required="true" />
				</p:column>
			</p:dataTable>
		</p:panel>
		<p:panel widgetVar="panel2" visible="#{myBean.showDemographics}">
			<p:dataTable var="demographic" value="#{myBean.demographics}">
				<p:column>
					<f:facet name="header">
						<h:outputText value="#{demographic.label}" />
					</f:facet>
					<h:outputText value="#{demographic.label}" />
				</p:column>
				<p:column>
					<f:facet name="header">
					</f:facet>
					<p:inputText id="userValue2" value="#{demographic.userValue}"
						required="#{demographic.mandatory}" />
				</p:column>
			</p:dataTable>
		</p:panel>
		<p:commandButton value="#{translationBean.navi_link_patient_search}"
			ajax="true" actionListener="#{myBean.searchPatients}"
			update="resultPanel" oncomplete="panelwv.show();">
		</p:commandButton>

		<p:panel widgetVar="panelwv" visible="false" closable="true"
			toggleable="true" id="resultPanel">
			<p:dataTable var="patient" value="#{myBean.patients}" emptyMessage="#{myBean.queryPatientsException}">
				<p:column>
					<f:facet name="header">
						<h:outputText value="#{translationBean.patient_data_surname}" />
					</f:facet>
					<h:outputText value="#{patient.familyName}" />
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:outputText value="#{translationBean.patient_data_givenname}" />
					</f:facet>
					<h:outputText value="#{patient.name}" />
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:outputText value="#{translationBean.patient_data_birth_date}" />
					</f:facet>
					<h:outputText value="#{patient.birthDate}" />
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:outputText
							value="#{translationBean.patient_data_street_address}" />
					</f:facet>
					<h:outputText value="#{patient.address}" />
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:outputText value="#{translationBean.patient_data_code}" />
					</f:facet>
					<h:outputText value="#{patient.postalCode}" />
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:outputText value="#{translationBean.patient_data_city}" />
					</f:facet>
					<h:outputText value="#{patient.city}" />
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:outputText value="#{translationBean.patient_data_country}" />
					</f:facet>
					<h:outputText value="#{patient.country}" />
				</p:column>
				<p:column>
					<!-- 	<f:facet name="header">
						<h:outputText value="Actions" />
					</f:facet>  -->
					<p:commandButton
						action="/viewPatientConfirmationForDocuments.xhtml?javax.portlet.faces.PortletMode=view&amp;javax.portlet.faces.WindowState=normal"
						ajax="false" icon="ui-icon-search"
						title="#{translationBean.navi_report_summary}"
						rendered="#{myBean.trcAssertionNotExists}"
						disabled="#{myBean.disablePatientDocuments}">
						<f:setPropertyActionListener value="#{patient}"
							target="#{myBean.selectedPatient}" />
					</p:commandButton>

					<p:commandButton
						action="/viewDocuments.xhtml?javax.portlet.faces.PortletMode=view&amp;javax.portlet.faces.WindowState=normal"
						ajax="false" icon="ui-icon-search"
						title="#{translationBean.navi_report_summary}"
						rendered="#{myBean.trcAssertionExists}"
						disabled="#{myBean.disablePatientDocuments}">
						<f:setPropertyActionListener value="#{patient}"
							target="#{myBean.selectedPatient}" />
					</p:commandButton>
					<p:commandButton
						action="/viewPrescriptions.xhtml?javax.portlet.faces.PortletMode=view&amp;javax.portlet.faces.WindowState=normal"
						ajax="false" icon="ui-icon-search"
						title="#{translationBean.report_prescription}"
						rendered="#{myBean.trcAssertionExists}"
						disabled="#{myBean.disablePrescriptionDocuments}">
						<f:setPropertyActionListener value="#{patient}"
							target="#{myBean.selectedPatient}" />
					</p:commandButton>
					<p:commandButton
						action="/viewPatientConfirmation.xhtml?javax.portlet.faces.PortletMode=view&amp;javax.portlet.faces.WindowState=normal"
						ajax="false" icon="ui-icon-search"
						title="#{translationBean.report_prescription}"
						rendered="#{myBean.trcAssertionNotExists}"
						disabled="#{myBean.disablePrescriptionDocuments}">
						<f:setPropertyActionListener value="#{patient}"
							target="#{myBean.selectedPatient}" />
					</p:commandButton>
					
				</p:column>
			</p:dataTable>
		</p:panel>
	</h:form>
</body>
</html>




